Copyright: Zero-1 Software Ltd. Copyright ® 1994.


Read Me
MDB->BAS Read Me

MDB->BAS v 3.6 -  Dec 94

This is a simple VB app that reads the structure of a MS Access MDB database file and produces the necessary VB code to create the file.

It handles all of the usual field and table attributes including attached tables, version 1.0, 1.1 & 2.0, query defs etc.

It optionally produces documentation of the MDB in the form of a seperate text file.

Author

Peter G Jones
Zero-1 Software Ltd.
PO Box 4475
Christchurch
New Zealand

Phone/Fax:  64, 3, 352 6481
CIS: 100032,40
Internet: jonesp@chch.planet.co.nz

Requirements

The following files are required to run MDB->BAS.  These files are not distributed because of their size, they are available elsewhere and most MDB->BAS users will probabky alreday have them:

VBRUN300.DLL
VBDB300.DLL
CMDIALOG.VBX
MSAES110.DLL
MSABC110.DLL

For version 2.0 MDB's you will need the Jet 2.0 compatability layer installed.  This includes:

MSABC200.DLL
MSAJT112.DLL

To use the generated code you will of course need VB 3 Professional, Access 2.0 or some other product that understands Microsoft SQL.

Poor-mans Data Dictionary

Also included is the ability to create an INI file description of the MDB.  This can be used with the supplied sample code to create the database.

The next major version will add the feature for automatically updating the database structure if the MDB does not match the INI file.

Access 2.0 MDB's

This version has been tested with the Jet 2 compat. layer for VB 3.  I have found only one possible problem thus far.  I tried it on our customer database which is an Access application.  It read the structure ok but for some reason, one of the tables has two primary key indexes.

When the data dict. code tries to create the table with these indexes it fails.

SQL

Version 3.0 can now optionally generate code that uses SQL CREATE TABLE and CREATE INDEX rather than the horrible Object stuff.  SQL does make the code much smaller and maybe faster.  However, Query Defs cannot be created using the SQL and there is also a bug in the compatability layer with Query Defs.

Registration

MDB->BAS can be registered in three ways:

•	Compuserve SWREG 3070 for EXE only.

•	Compuserve SWREG 3738 for EXE & Source Code.

•	EMail your Visa Card details to the author listed above.

The charge is $US20 for EXE or $US40 for source & EXE.  Files will only be EMailed so don't bother trying snail mail or phone/fax.

Disclaimer

I take no responsibility for anything that doesn't work and full responsibility for everything that does!  And if you think you can sue me then think again!  I run faster than any lawyer I know!

Revision History

 Version 1.0, June 1994

 Version 1.1, July 20 1994

 Version 1.2, September 14, 1994

 Version 2.0, October 1, 1994

 Version 3.0, October 25, 1994

 Version 3.1, October 28, 1994

 Version 3.2, October 30, 1994

 Version 3.3, November 5, 1994

 Version 3.4, November 18, 1994

 Version 3.5, November 23, 1994

 Version 3.6, December 13, 1994

Wish List

Please feel free to send me any suggestions or requests.  This is what I have so far.  The % figure in the title is the likelihood of the item being done.  The higher the %, the sooner it will get done.

Expand Data Dictionary (95%)

•	Use the data dictionary to check the structure of a database and to update it should it be necessary.

Support Foreign Keys (90%)

•	Assuming this is possible with VB in the near future - and I can learn what a foreign key REALLY is.

Create Database (80%)

•	After generating SQL to screen, it should be possible to alter the statements and then click a Create button to make the database.  What about the data?.  Should the data in the original table be copied also?


Version10
Version 1.0 - June 1994

•	Initial public release.


Version11
Version 1.1, July 20 1994

•	Altered code generation to use a single set or arrays rather than two arrays for each table.  This fixed memory problems.

•	Added langauge support combo box.

•	Minor fixes to generated code.

•	SWREGification.


Version12
Version 1.2, September 14, 1994

•	Altered status display for speed!


Version20
Version 2.0, October 1, 1994

•	Added INI file generation.

•	Tested with Jet 2 compat. layer.

•	Added sample code for data dictionary - to be expanded later.

•	Added connect string prompt.

•	Added check boxes for various file generation.


Version30
Version 3.0, October 25, 1994

•	Added SQL code generation as an option to the object based method.

•	Added Access code generation.

•	Added SQL statement generation.

•	Removed version 1.0 option - now defaults to engine version.

•	Reworked code substantially for new options. Speed and fixes.

•	Changed pricing structure - source code is now a seperate registration.

•	Internet-a-fied.


Version31
Version 3.1, October 28, 1994

•	Improved error handling when generating Query Defs on tables that no longer exist.  Errors are now trapped, reported and code comments are generated.

•	Cleaned up help file. Fixed help index page... I killed it!  Used pop-ups etc.

•	Altered filename controls to automatically reflect the name of the database file.

•	Fixed occasional chr(0) in code and documentation files.  This was caused by Query Defs ending in a NULL.

Thanks to Randy Parker for the gamma testing!


Version32
Version 3.2, October 30, 1994

•	Fixed bug when Query Defs option was turned off.

•	Remove "WITH OWNERACCESS OPTION" from Query Defs when not generating VB code as VB spits on this.

•	More code tidy-ups.


Version33
Version 3.3, November 5, 1994

•	Removed forcing upper case to connect string.

•	Fixed bug when Query Defs option was off.


Version34
Version 3.4, November 18, 1994

•	Changed file creation to handle larger files.  Saving the generated text to strings before writing was causing string space problems on very large databases.

•	Finally fixed bug that was stopping file writing!


Version35
Version 3.5, November 23, 1994

•	Only generate PRIMARY index for first primary index found in each table.  This works around the problem of the Jet 2.0 engine reporting more than one primary key index.  Hopefully, the first primary key index will usually be the right one...

•	Correctly bracketed field list in index clauses.  Fields with spaces and other non alpha characters where causing problems.

•	Removed reference to MB_ICONSTOP as most Access programmers are probably not going to have this defined by default.


Version36
Version 3.6, December 13, 1994

•	Fixed index field correction code for descending indecies.